package com.suny.thread_per_message;

import java.util.concurrent.Executor;

public class ExecutorHost {
    private final Helper helper = new Helper();
    private final Executor executor;

    public ExecutorHost(Executor executor) {
        this.executor = executor;
    }

    public void request(int count, char c) {
        System.out.println("      request(" + count + ", " + c + ") BEGIN");

        executor.execute(() -> helper.handle(count,c));
        System.out.println("      request( " + count + ", " + c + ") END");

    }
}
